/**
* 地图的标注 
*/
package com.imax.emap.overlay
{
	import com.imax.emap.core.LatLon;
	
	import flash.display.DisplayObject;
	import flash.geom.Point;
	
	import mx.controls.Image;
	import mx.core.UIComponent;
	
	public class Marker1 extends Object
	{
		public var latLon:LatLon;
		public var icon:UIComponent;
		public var iconOffset:Point;
		//默认的标注
		[Embed(source="/assets/icons/red-dot.png")]
		public var DefaultIcon:Class;
		
		public function Marker1(_latLon:LatLon,_toolTip:String = "",_icon:UIComponent = null,_iconOffset:Point = null)
		{
						
			if( _latLon == null){
				this.latLon = new LatLon(0,0);
			}
			else {
				latLon = _latLon;
			}
			
			if( _iconOffset == null){ 
				this.iconOffset = new Point(0,0) 
			}
			else { 
				this.iconOffset = _iconOffset  
			}
			
			if(_icon == null){
				//这个用photoshop看就ok，按F8，把单位改成像素查看，默认的是厘米
				this.iconOffset = new Point(16,32);
				var image:Image = new Image();	
				image.source = new DefaultIcon();
				this.icon=image;
			}
			else{
				this.icon = _icon;
			}
			
			//this.addChild(this.icon);
			
			if(_toolTip.length != 0){
				this.icon.toolTip = _toolTip;
			}
			
			
		}
		
		public function toString():String{
			return "Marker(iconOffset:" + iconOffset.toString() + " " +latLon.toString() +")";
		}
	}
}